package cn.cdeden.knowledge.service;


import cn.cdeden.common.core.utils.page.TableDataInfo;
import cn.cdeden.knowledge.domain.SysCalendar;
import cn.cdeden.knowledge.domain.dto.MissionToCalendarDTO;
import cn.cdeden.knowledge.domain.dto.SysCalendarDto;
import cn.cdeden.knowledge.domain.dto.SysCalendarQueryParam;

import cn.cdeden.knowledge.domain.vo.SysCalendarVO;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Set;

/**
* @author Yu.
* @date 2023-02-02
*/
public interface SysCalendarService extends IService<SysCalendar> {

    static final String CACHE_KEY = "sysCalendar";

    /**
    * 查询数据分页
    * @param query 条件
    * @param pageable 分页参数
    * @return PageInfo<SysCalendarDto>
    */
    TableDataInfo<SysCalendarDto> queryAll(SysCalendarQueryParam query, Pageable pageable);

    /**
    * 查询所有数据不分页
    * @param query 条件参数
    * @return List<SysCalendarDto>
    */
    List<SysCalendarDto> queryAll(SysCalendarQueryParam query);

    TableDataInfo<SysCalendarDto> queryPageAll(SysCalendarQueryParam query, Pageable pageable);

    SysCalendar getById(Long id);
    SysCalendarDto findById(Long id);

    /**
     * 插入一条新数据。
     */
    boolean insert(SysCalendarDto resources);
    boolean updateById(SysCalendarDto resources);
    boolean deleteById(Long id);
    boolean deleteByIds(Set<Long> ids);

    /**
    * 导出数据
    * @param all 待导出的数据
    * @param response /
    * @throws IOException /
    */
    // void download(List<SysCalendarDto> all, HttpServletResponse response) throws IOException;

    /**
     *获取周报的信息
     * @param startTime
     * @param username
     * @return
     */
    SysCalendarVO getWeekly(String startTime, String username);


    /**
     * 我的任务加入日程
     * @param missionToCalendarDTO
     * @return
     */
    Boolean fromMissionToCalenadr(MissionToCalendarDTO missionToCalendarDTO);

    /**
     * 修改日程中我的任务
     * @param missionToCalendarDTO
     * @return
     */
    Boolean updateMissionCalendar(MissionToCalendarDTO missionToCalendarDTO);

    /**
     * 删除日程中我的任务
     * @param missionId
     * @return
     */
    Boolean removeMissionCalendar(Long missionId);

    List<SysCalendar> getDetailShow(Long calendarId);

}
